Skip to content

implement ObjectIdAutoField.deconstruct() #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

timgraham
Copy link
Collaborator

No description provided.

Remove "auto" from path and omit default db_column from kwargs.
Copy link
Contributor

@Jibola Jibola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +22 to +23
if path.startswith("django_mongodb.fields.auto"):
path = path.replace("django_mongodb.fields.auto", "django_mongodb.fields")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we do this? Just for consistency in path imports or is there a technical reason, too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to https://github.com/django/django/blob/163e72ebbaa84804877f3d1ae212575e479b533b/django/db/models/fields/__init__.py#L646-L657, the fact that our fields are implemented in submodules of django_mongodb.fields is an implementation detail that's fine to hide from end users.

@timgraham timgraham merged commit a06efe3 into mongodb:main Oct 29, 2024
3 checks passed
@timgraham timgraham deleted the ObjectIdAutoField.deconstruct branch October 29, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants